package be.donovan.gui.helper;


public class InfoProvider {
	private static String version;
	static {
		version = InfoProvider.class.getPackage().getImplementationTitle();
		if(version == null){
			version = "DEVELOP";
		}
	}

	public static String getApplicationVersion() {
		return "Quebak - "+  version;
	}

	public static String getApplicationEnvironment() {
		String environment = System.getProperty("application.environment");
		if (environment == null) {
			environment = "Development";
		}
		return "Environment : " + environment;
	}

//	public static String getLogInName() {
//		String username = null;
//		SecurityContext context = SecurityContextHolder.getContext();
//		if (context != null && context.getAuthentication() != null) {
//			Object obj = context.getAuthentication().getPrincipal();
//			if (obj instanceof UserDetails) {
//				username = ((UserDetails) obj).getUsername();
//			} else {
//				username = obj.toString();
//			}
//		}
//		if (username == null) {
//			try {
//				username = Credentials.acquireDefaultCreds().getClient()
//						.getPrincipalNameAsString();
//			} catch (UnsatisfiedLinkError e) {
//				// TODO: handle exception
//				// does not work on LINUX ??
//			}
//		}
//		return (username == null ? "UNKNOWN USER" : username);
//	}
}
